<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="" />
<meta name="author" content="ChongMing" />
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="full-screen" content="yes">
<meta name="screen-orientation" content="portrait">
<meta name="x5-fullscreen" content="true">
<meta name="360-fullscreen" content="true">
<title>明星医生</title>
</head>
<link rel="stylesheet" href="../css/framework7.ios.min.css">
<link rel="stylesheet" href="../css/framework7.ios.colors.min.css">
<link rel="stylesheet" href="../css/my-app.css">
<link rel="stylesheet" href="../css/reset.css">
<link rel="stylesheet" href="css/consultation.css">
<script src="../js/jquery-1.7.1.min.js"></script>
<script src="../js/jquery.mobile-1.4.3.js"></script>
<script type="text/javascript" src="../js/framework7.min.js"></script>
<script type="text/javascript" src="../js/my-app.js"></script>
<script type="text/javascript" src="../js/jquery.cookie.js"></script>
<script src="js/consultation.js"></script>
<script>
    $(function(){
        var myApp = new Framework7();
        var $$ = Dom7;
        page_index = 1;
        page_size = 12;
        var grp_id = consultationinterface.getQueryString('grp_id')
        consultationinterface.starDoctorList(grp_id,page_index);
        var uid = $.cookie('local_userId');
//        点击赞
        $('.dactor-list .doctor-details .interaction .zan img').live('click',function(e){
            e.stopPropagation()
           var text = $(this).siblings('span').html();
            var docror_id = $(this).data('id');
            var obj = $(this)
//            if($(this).hasClass('hover')){
//                alert('您已经点过赞了')
//            }else{
//                text++
//                $(this).siblings('span').html(text);
//                $(this).addClass('hover');
//            }
            consultationinterface.doctorlike(uid,docror_id,obj,text)
        });
        $('.dactor-list .doctor-details').live('click',function(){
            var doctor_id = $(this).data('id')
            location.href = '../chooseDoctor/docterDetail.html?docterId='+doctor_id
        });
//        下拉刷新
        $$('.pull-to-refresh-content').on('refresh', function (e) {
            page_index=1
            $('.infinite-scroll-preloader').html('<div class="preloader"></div>')
            setTimeout(function () {
                $('#star-doctor-list').html('');
                consultationinterface.starDoctorList(grp_id,page_index);
                myApp.pullToRefreshDone();
            }, 1000);
        });
//        下拉加载
        var loading = false;
        $$('.infinite-scroll').on('infinite', function () {
            // 如果正在加载，则退出
            if (loading) return;
            // 设置flag
            loading = true;
            // 模拟1s的加载过程
            setTimeout(function () {
                // 重置加载flag
                loading = false;
                page_index++
                consultationinterface.starDoctorList(grp_id,page_index);
            }, 500);
        });
    });
</script>
<body>
<div class="dactor-list">
    <div class="views" style=" margin-top: 0">
        <div class="view view-main" data-page="home">
            <div class="pages navbar-through">
                <div data-page="home" class="page" style=" background: #ebebeb;">
                    <div class="page-content pull-to-refresh-content infinite-scroll">
                        <div class="pull-to-refresh-layer">
                            <div class="preloader"></div>
                            <div class="pull-to-refresh-arrow"></div>
                        </div>
                        <div class="list-block" id="star-doctor-list">

                        </div>
                        <div class="infinite-scroll-preloader" style=" padding: 5px">
                            <div class="preloader"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
</html>